home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 002 / make / make.h < prev    next >
C/C++ Source or Header  |  1995-03-17  |  5KB  |  173 lines

  1. /* #define    VAXVMS    1 */        /* uncomment for VAX/VMS */
  2. /* #define    MSDOS    1 */        /* uncomment for MSDOS */
  3.  
  4. /* NOTE: other two supported systems, "unix" and "AMIGA" have these symbols */
  5. /* built into the preprocessor.  Redefining them may cause problems, or at */
  6. /* least irritating warning messages. */
  7.  
  8. #if VAXVMS
  9. #  define ESCCHAR `\\`        /* ok to use backslash on VMS */
  10. #endif
  11.  
  12. #ifdef MSDOS
  13. #  define ESCCHAR '`'        /* since pathname char is backslash (yech) */
  14. #endif
  15.  
  16. #if unix || AMIGA
  17. #  define ESCCHAR '\\'
  18. #endif
  19.  
  20. #define EOS '\000'        /* End of string character */
  21.  
  22. #define    MACCHAR '$'        /* macro-definition char */
  23. #define    COMCHAR    '#'        /* comment char */
  24. #define    DEFMAC    "="        /* macro-definition token */
  25. #define    DEPEND    ":"        /* dependency-definition token */
  26.  
  27. #ifdef FUNNYLIBS
  28. #  define BGNLIB  "["        /* start library token */
  29. #  define ENDLIB  "]"        /* end library token */
  30. #else
  31. #  define ISLIB   "|"        /* Library definition token */
  32. #endif
  33.  
  34. #define BGNARC  "("        /* start archive token */
  35. #define ENDARC  ")"        /* end archive token */
  36.  
  37. #define    DEBUG    (0)
  38. #define    STRSIZ    (1024)        /* Size of input buffer */
  39. #define    MAXMODS    (50)        /* Max number of targets on command line */
  40. #define MAXCMDMACS (16)        /* Max number of macro defs on command line */
  41.  
  42. #if DEBUG
  43. #  define NOREALEXECUTE        /* if set, don't really execute commands */
  44. #  define NOREALEXTRACT        /* if set, don't really extract files */
  45. #  define NOREALDELETE        /* if set, don't really delete files */
  46. #endif
  47.  
  48. #define SUCCEED (0)
  49. #define FAILURE (-1)
  50.  
  51. /* file attributes */
  52.  
  53. #define    REBUILT    0x01        /* file has been reconstructed */
  54. #define    ROOTP    0x02        /* file was named on left side of DEPEND */
  55. #define LIBRARY 0x04        /* file is library; inherit parent's time */
  56. #define ARCHIVE 0x08        /* file is archive; search through parent */
  57.                 /* archive directory for time */
  58. #define EXTRACT 0x10        /* extract from archive when rebuilding */
  59. #define ERROR   0x20        /* error occurred while rebuilding */
  60.  
  61. #ifdef VAXVMS
  62. struct date_str {
  63.     unsigned ds_low;
  64.     unsigned ds_high;
  65. };
  66. typedef struct date_str *DATE;
  67. #endif
  68.  
  69. #ifdef MSDOS
  70. #  ifndef FA_ARCH
  71. #    include <bdos.h>
  72. #  endif
  73.    typedef struct ftime *DATE;
  74. #endif
  75.  
  76. #ifdef unix
  77.   typedef long *DATE;
  78. #endif
  79.  
  80. #ifdef AMIGA
  81. #  include <libraries/dos.h>
  82.    typedef struct DateStamp *DATE;
  83. #endif
  84.  
  85. #ifdef DBUG
  86. #  include <local/dbug.h>
  87. #else
  88. #  define DBUG_ENTER(a1)
  89. #  define DBUG_RETURN(a1) return(a1)
  90. #  define DBUG_VOID_RETURN return
  91. #  define DBUG_EXECUTE(keyword,a1)
  92. #  define DBUG_2(keyword,format)
  93. #  define DBUG_3(keyword,format,a1)
  94. #  define DBUG_4(keyword,format,a1,a2)
  95. #  define DBUG_5(keyword,format,a1,a2,a3)
  96. #  define DBUG_PUSH(a1)
  97. #  define DBUG_POP()
  98. #  define DBUG_PROCESS(a1)
  99. #  define DBUG_FILE (stderr)
  100. #  define DBUG_SETJMP setjmp
  101. #  define DBUG_LONGJMP longjmp
  102. #endif
  103.  
  104. struct node {
  105.     struct filenode *nfile;    /* this node's file */
  106.     struct node *nnext;        /* the next node */
  107. };
  108. typedef struct node NODE;
  109.  
  110.  
  111. struct filenode {
  112.     char *fname;        /* the filename */
  113.     char *fmake;        /* remake string for file */
  114.     DATE fdate;            /* last modification date */
  115.     NODE *fnode;        /* files this file depends on */
  116.     char fflag;            /* magic flag bits */
  117.     struct filenode *parent;    /* pointer to parent for archives,libraries */
  118.     struct filenode *fnext;    /* the next file */
  119. };
  120. typedef struct filenode FILENODE;
  121.  
  122.  
  123. struct macro {
  124.     char *mname;        /* the macro's name */
  125.     char *mvalue;        /* the macro's definition */
  126.     struct macro *mnext;    /* the next macro */
  127. };
  128. typedef struct macro MACRO;
  129.  
  130.  
  131. extern long *Calloc ();        /* Private gateway to system calloc() */
  132. extern MACRO *mroot;
  133. extern FILENODE *froot;
  134. extern DATE bigbang;        /* Far, far in the past */
  135. extern DATE endoftime;        /* Far, far in the future */
  136. char *gmacro ();
  137. FILENODE *gfile ();
  138. FILENODE *filenode ();
  139. char *token ();
  140.  
  141. #if unix || AMIGA
  142. #  define _open open
  143. #  define _close close
  144. #  define _read read
  145. #  define _write write
  146. #endif
  147.  
  148. /*
  149.  *    On the Amiga, we must do an explicit check for an abort at various
  150.  *    places of interest.  To avoid #ifdefs all through the code, define
  151.  *    some macros that just expand to null on other systems.
  152.  *
  153.  */
  154.  
  155. #ifdef AMIGA
  156.    void Check_Abort ();
  157.    extern int Enable_Abort;            /* Enable abort on CNTL-C */
  158. #  define ENABLE_ABORT (Enable_Abort = 1)
  159. #  define DISABLE_ABORT (Enable_Abort = 0)
  160. #  define CHECK_ABORT Check_Abort();
  161. #else
  162. #  define CHECK_ABORT                /* Null expansions */
  163. #  define ENABLE_ABORT
  164. #  define DISABLE_ABORT
  165. #endif    /* AMIGA */
  166.  
  167. /*
  168.  *    Some useful macros to make things slightly less error prone.
  169.  */
  170.  
  171. #define STRSAME(a,b) (strcmp(a,b)==0)        /* Strings are the same */
  172.  
  173.